package com.lzy.cloud.order.remote;

import com.lzy.cloud.order.dtos.AccountWalletInfoDto;
import com.lzy.cloud.order.remote.dtos.AccountWalletDto;
import com.lzy.framework.core.output.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Description: 账户信息接口
 * @Author:   gyl
 * @Date:     2018/7/9 17:25
 */
@FeignClient(name = "lzy-cloud-account")
public interface AccountWalletApi {

    /**
     * 方法说明：根据条件查询钱包信息
     * @param accountWalletDto
     * @return      
     * @date        2018/7/9 17:31
     */
    @RequestMapping(value = "/account/find", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    Result findById(@RequestBody AccountWalletDto accountWalletDto);

    /**
     * 余额变成冻结金额
     * @param accountWalletDto
     * @return
     */
    @RequestMapping(value = "/account/balance/become/frozen/amount",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    Result balanceBecomeFrozenAmount(@RequestBody AccountWalletDto accountWalletDto);

    /**
     * 冻结金额变成余额
     * @param accountWalletDto
     * @return
     */
    @RequestMapping(value = "/account/frozen/amount/become/balance",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    Result frozenAmountBecomeBalance(@RequestBody AccountWalletDto accountWalletDto);

    /**
     * 更新可用余额
     * @param accountWalletInfoDto
     * @return
     */
    @RequestMapping(value = "/update/by/primary/key",method = RequestMethod.POST)
    Result updateByPrimaryKey(AccountWalletInfoDto accountWalletInfoDto);
}
